package com.service.impl;

import com.dao.UserManagerDao;
import com.dao.impl.UserManagerDaoImpl;
import com.pojo.Users;
import com.service.UserManagerService;
import java.util.List;

/*
* 用户管理业务层
* */
public class UserManagerServiceImpl implements UserManagerService {

    UserManagerDao userManagerDao =new UserManagerDaoImpl();
    /*
    * 添加用户
    * */
    @Override
    public void addUser(Users users) {
        userManagerDao.insertUser(users);
    }

    /*
    * 查询用户
    * */
    @Override
    public List<Users> selectUser(Users users) {
        return userManagerDao.selectUser(users);
    }

    /*
    * 根据用户id查询用户
    * */
    @Override
    public Users selectUserByUserId(int id) {
        return userManagerDao.selectUserByUserId(id);
    }

    /*
    * 修改用户
    * */
    @Override
    public void modifyUser(Users users) {
        userManagerDao.updateUserByUserId(users);
    }

    @Override
    public void dropUser(int userid) {
        userManagerDao.deleteUserById(userid);
    }
}
